//导入express
const express = require('express')

const app = express()

//导出接收POST 请求数据模块
const bodyParser = require('body-parser')

// 设置 接收post请求数据 req.body 
app.use(bodyParser.urlencoded({ extended: false }))

const main = require('./router/main')

require('./database/init')

require('./database/model/User')

//为main匹配 地址 /api
app.use('/api',main)

//监听8888端口
app.listen(8888)